const db = wx.cloud.database()

export const postNewsApi = (data: Recordable) =>
  db.collection('news').add({
    data
  })

export const postIntelligenceApi = (data: Recordable) =>
  db.collection('intelligence').add({
    data
  })

export const getNewsApi = () => db.collection('news').get()
export const getIntelligenceApi = () => db.collection('intelligence').get()
export const getAccodentApi = () => db.collection('accidentde').get()
export const getAccodentDetailApi = (_id: string) =>
  db.collection('accidentde').where({ _id }).get()
